package com.example.mybatisplus.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.mybatisplus.model.domain.WhitelistSetting;
import com.example.mybatisplus.mapper.WhitelistSettingMapper;
import com.example.mybatisplus.model.dto.PageDTO;
import com.example.mybatisplus.model.vo.StatVO;
import com.example.mybatisplus.service.WhitelistSettingService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lxp
 * @since 2024-12-12
 */
@Service
public class WhitelistSettingServiceImpl extends ServiceImpl<WhitelistSettingMapper, WhitelistSetting> implements WhitelistSettingService {

    @Autowired
    private WhitelistSettingMapper whitelistSettingMapper;

    @Override
    public WhitelistSetting login(WhitelistSetting whitelistSetting) {

        return whitelistSettingMapper.login(whitelistSetting);
    }

    @Override
    public Page<WhitelistSetting> pageList(PageDTO pageDTO, WhitelistSetting whitelistSetting) {
        Page<WhitelistSetting> page = new Page<>(pageDTO.getPageNum(),pageDTO.getPageSize());

        return whitelistSettingMapper.pageList(page,whitelistSetting);
    }

    @Override
    public List<StatVO> stat() {
        return whitelistSettingMapper.stat();
    }
}
